package cn.itutu.demo.log4j;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import java.io.IOException;
import java.sql.SQLException;

/**
 * Created by itutu on 2018/4/13.
 * Description: 如何使用log4j2
 */
public class log4j2Demo {
    //    获取日志记录器（类名）
    public static Logger logger = LogManager.getLogger(log4jDemo.class.getName());

    public static void main(String[] args) throws IOException, SQLException {
        logger.trace("log4j2:Trace Message!");
        logger.debug("log4j2:Debug Message!");
        logger.info("log4j2:Info Message!");
        logger.warn("log4j2:Warn Message!");
        logger.error("log4j2:Error Message!");
        logger.fatal("log4j2:Fatal Message!");
    }
}
